function fn(a, b) {
	console.log("a", a);
	console.log("b", b);
	console.log("this", this);
	return "hello";
}

Function.prototype.myApply = function (obj) {
	// 获取参数
	let args = [...arguments];
	// 获取this
	let self = this;

	obj.fn = self;
	let res = obj.fn(...args[1]);
	delete obj.fn;
	return res;
};
// const res = fn.apply({ x: 10 }, [20, 30])
const res = fn.myApply({ x: 10 }, [20, 30]);
console.log("res", res);
